<template>
  <div class="app-container">
    <div class="box" @click="add">
      <div class="content">我要上报</div>
    </div>
    <div class="box" @click="his">
      <div class="content">历史记录</div>
    </div>
  </div>
</template>

<script setup>
import { useRoute, useRouter } from 'vue-router'
import { onMounted } from 'vue'

import { Publics } from '@/stores/public.js'
import { storeToRefs } from 'pinia'

const publics = Publics()

const router = useRouter()
const route = useRoute()
const add = () => {
  console.log('add')
  router.push('/padd')
}
const his = () => {
  console.log('his')
  router.push('/phistory')
}

onMounted(() => {
  publics.loadId(route.query.id)
})
</script>

<style lang="scss">
.app-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100vh;
  background-color: #f5f5f5;
}

.box {
  width: 240px;
  height: 100px;
  background-color: #e0e0e0;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.box:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.content {
  font-size: 16px;
  color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
}
</style>
